import time

class Hero():

    def __init__(self, name, hp, level=1):
        self.name = name
        self.hp = hp
        self.level = level
        self.status = True

    def set_hp(self, add_hp):
        print("英雄升级了，血量提升。。。")
        self.hp += add_hp

    def up_level(self):
        self.level += 1
        print("英雄等级+1，当前等级：{}".format(self.level))
        self.set_hp(100)

    def killed(self):
        print("英雄{}被杀死了".format(self.name))
        self.status = False
        self.wait_up()

    def wait_up(self):
        print("英雄复活中。。。。")
        time.sleep(5)
        self.status = True
        print("英雄已复活。。。。")

    # def __del__(self):
    #     print("英雄{}阵亡了".format(self.name))


print("进入游戏，创建角色".center(50, "*"))
jiansheng = Hero("剑圣", 1800)

print("英雄上线收了一波小兵".center(50, "*"))
jiansheng.up_level()

print("英雄杀掉了对方英雄".center(50, "*"))
jiansheng.up_level()

print("英雄被杀死了".center(50,"*"))
# del jiansheng
jiansheng.killed()

print("游戏结束".center(50, "*"))

